<?php
ini_set('display_errors',1);
set_time_limit(0); 
include_once dirname(dirname(dirname(__FILE__))).'/mgtv_init.php';
include_once dirname(dirname(__FILE__)).'/init.php';

$list = file('dsj.txt');
$db = nl_get_db(NL_DB_READ);
$db->open();
foreach($list as $val){	
	$sql = "select nns_id,nns_all_index,nns_name from nns_vod where nns_name='".trim($val)."'";	
	$info = nl_db_get_one($sql, $db);
	if(empty($info)){
		continue;
	}
	$id = $info['nns_id'];
	$flag = 1;
	if($info['nns_all_index']==1){
		$id = nl_db_get_col("select nns_id from nns_vod_index where nns_vod_id='".$info['nns_id']."'", $db);
		$flag = 0;
	}
	
	$data  = array(
		'nns_id'=>$id,
		'nns_task_name'=>$info['nns_name'].'--栏目绑定',
		'category_id'=>10000002006,
		'flag'=>$flag
	);
	unset($val);
	c2_task_model::band_category($data);
	
}
?>